package com.example.boot.utils;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author yuhang
 * @create 2021-03-22 14:19
 */
@Data
public class Result {
    private boolean code;
    private String msg;
    private Map<String,Object> extend=new HashMap<>();
    public static Result success(){
        Result result=new Result();
        result.setCode(true);
        result.setMsg("成功");
        return result;
    }
    public Result add(String key,Object value){
         this.getExtend().put(key, value);
         return this;
    }
    public static Result fail(){
        Result result=new Result();
        result.setCode(false);
        result.setMsg("失败");
        return result;
    }
}
